#!/sbin/openrc-run
supervisor=supervise-daemon

name="mautrix-gvoice"
description="Daemon for mautrix-gvoice, a Matrix-Google Voice puppeting bridge"

: ${config:="/etc/mautrix-gvoice/config.yaml"}
: ${command_user:="mautrix-gvoice:mautrix-gvoice"}

command="/usr/bin/mautrix-gvoice"
command_args="-c $config $command_args"

depend() {
	need net
}

start_pre() {
	checkpath --file --owner "$command_user" "$config"
	checkpath --directory --owner "$command_user" /var/log/mautrix-gvoice
}
